import { Row, Col } from 'antd'
import React, { Component } from 'react'
import { connect } from 'react-redux'
import { createAddCommodity } from '../../../../redux/action/cashier_orderItem_action'

class CashierSelectItem extends Component {


    render() {
        const { cname, specification, unit, price, cid, ctype, barCode, storeId } = this.props
        return (
            <div>
                <Row onClick={() => { this.props.addCommodity({ cname, cid, specification, unit, price, ctype, barCode, storeId }); this.props.seachCallBack() }} className="selectItem" style={{ padding: "8px 0px" }}>
                    <Col span={8}>
                        {cname}
                    </Col>
                    <Col span={6}>{specification}</Col>
                    <Col span={4}>{unit}</Col>
                    <Col span={6}>{(price * 1).toFixed(2)}</Col>
                </Row>
            </div>
        )
    }
}
export default connect(
    status => ({}),
    {
        addCommodity: createAddCommodity
    }
)(CashierSelectItem)